<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>报废审核页面</title>
    <link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico">
    <link rel="stylesheet" href="/element-theme/blue/index.css">
    <style type="text/css">
        .container{
            width: 100%;
            border: 1px solid #00ffff;
        }
    </style>

</head>

<body>
    <div class="data-manage-table">
        <template>
            <el-form ref="form" :inline="true" style="padding:20px 20px 0 20px;">
                <!-- <el-button type="primary" style="margin-right: 40px;">批量删除</el-button> -->
                <el-form-item label="申请编号">
                    <el-input placeholder="请输入申请编号" v-model="searchapply.discardapplyid"></el-input>
                </el-form-item>
                <el-form-item label="申请人工号">
                    <el-input placeholder="请输入申请人工号" v-model="searchapply.applyid"></el-input>
                </el-form-item>
                <el-form-item label="当前状态">
                    <el-select v-model="searchapply.state">
                        <el-option v-for="item in stateselect" :key="item.code" :label="item.name" :value="item.code">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="申请日期">
                    <el-date-picker v-model="searchapply.dateVal" type="daterange" size="small" format="yyyy-MM-dd"
                        range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="queryload">搜索</el-button>
                    <el-button type="info" @click="reset">重置</el-button>
                </el-form-item>
            </el-form>

            <el-dialog title="填写审核信息" center :visible.sync="dialogFormVisible" width="1000px" @close="cancel">
                <!-- 内容的主体区域 -->
                    <el-descriptions :column="3" :size="size" border>
                    <el-descriptions-item>
                        <template slot="label">
                            申请编号:
                        </template>
                        {{selectform.applyId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血装编号条码:
                        </template>
                        {{selectform.barcode}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液ID:
                        </template>
                        {{selectform.bloodId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液成分:
                        </template>
                        {{getBloodComponentName(selectform.bloodComponent)}}
                    </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                ABO血型:
                            </template>
                            {{getAboBloodName(selectform.aboBloodType)}}
                        </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            RH血型:
                        </template>
                        {{getRhBloodName(selectform.rhBloodType)}}
                    </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                血量:
                            </template>
                            {{getBloodSizeName(selectform.bloodCount)}}
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                计量单位:
                            </template>
                            {{selectform.measurementUnit}}
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                血液来源:
                            </template>
                            {{getBloodSourceName(selectform.bloodSource)}}
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                血液金额:
                            </template>
                            {{selectform.bloodAmount}}
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                报废原因:
                            </template>
                            {{getblooddiscardreasonName(selectform.scrapReason)}}
                        </el-descriptions-item>
                        <el-descriptions-item>

                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                审核人工号:
                            </template>
                            {{selectform.reviewerId}}
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                审核人:
                            </template>
                            {{selectform.reviewer}}
                        </el-descriptions-item>
                    </el-descriptions>
<!--                <el-form ref="form" :model="selectform"  label-width="120px" :label-position="labelPosition">-->
<!--                    <el-row>-->
<!--                        <el-col :span="10">-->
<!--                    <el-form-item label="审核人工号" prop="reviewerId" >-->
<!--                        <el-input v-model="selectform.reviewerId" style="width:180px; float: right;"></el-input>-->
<!--                    </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="10">-->
<!--                    <el-form-item label="审核人" prop="reviewer">-->
<!--                        <el-input v-model="selectform.reviewer" style="width:180px; float: right;"></el-input>-->
<!--                    </el-form-item>-->
<!--                        </el-col>-->
<!--                    </el-row>-->

<!--                </el-form>-->
<!--                    <el-form-item label="申请编号" prop="applyId">-->
<!--                        <el-input v-model="selectform.applyId" readonly  ></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血装编号条码" prop="barcode">-->
<!--                        <el-input v-model="selectform.barcode" readonly  ></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血液ID" prop="bloodId">-->
<!--                        <el-input v-model="selectform.bloodId" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血液成分" prop="bloodComponent">-->
<!--                        <el-input v-model="selectform.bloodComponent" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="RH血型" prop="rhBloodType">-->
<!--                        <el-input v-model="selectform.rhBloodType" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="ABO血型" prop="aboBloodType">-->
<!--                        <el-input v-model="selectform.aboBloodType" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血量" prop="bloodCount">-->
<!--                        <el-input v-model="selectform.bloodCount" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="计量单位" prop="measurementUnit">-->
<!--                        <el-input v-model="selectform.measurementUnit" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血液来源" prop="bloodSource">-->
<!--                        <el-input v-model="selectform.bloodSource" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="血液金额" prop="bloodAmount">-->
<!--                        <el-input v-model="selectform.bloodAmount" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
<!--                    <el-form-item label="报废原因" prop="scrapReason">-->
<!--                        <el-input v-model="selectform.scrapReason" :disabled="true"></el-input>-->
<!--                    </el-form-item>-->
                <!-- 底部区域 -->
                <span slot="footer" class="dialog-footer">

                    <el-button type="primary" @click="aduitsuccess">审核通过</el-button>
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                </span>
            </el-dialog>
            <el-dialog title="填写驳回信息" center :visible.sync="dialogFormVisible1" width="1000px" @close="cancel">
                <!-- 内容的主体区域 -->
                <el-descriptions :column="3" :size="size" border>
                    <el-descriptions-item>
                        <template slot="label">
                            申请编号:
                        </template>
                        {{selectform.applyId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血装编号条码:
                        </template>
                        {{selectform.barcode}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液ID:
                        </template>
                        {{selectform.bloodId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液成分:
                        </template>
                        {{getBloodComponentName(selectform.bloodComponent)}}
                    </el-descriptions-item>

                    <el-descriptions-item>
                        <template slot="label">
                            ABO血型:
                        </template>
                        {{getAboBloodName(selectform.aboBloodType)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            RH血型:
                        </template>
                        {{getRhBloodName(selectform.rhBloodType)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血量:
                        </template>
                        {{getBloodSizeName(selectform.bloodCount)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            计量单位:
                        </template>
                        {{selectform.measurementUnit}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液来源:
                        </template>
                        {{getBloodSourceName(selectform.bloodSource)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            血液金额:
                        </template>
                        {{selectform.bloodAmount}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            报废原因:
                        </template>
                        {{getblooddiscardreasonName(selectform.scrapReason)}}
                    </el-descriptions-item>
                    <el-descriptions-item>

                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            驳回人工号:
                        </template>
                        {{selectform.reviewerId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            驳回人:
                        </template>
                        {{selectform.reviewer}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            驳回原因:
                        </template>
                        <el-input v-model="selectform.rejectReason" style="width:180px;"></el-input>
                    </el-descriptions-item>
                </el-descriptions>
<!--                <el-form ref="form" :model="selectform"  label-width="120px" :label-position="labelPosition">-->
<!--                    <el-form-item label="驳回原因" prop="rejectReason">-->
<!--                        <el-input v-model="selectform.rejectReason"></el-input>-->
<!--                    </el-form-item>-->

<!--                </el-form>-->
                <!-- 底部区域 -->
                <span slot="footer" class="dialog-footer">

                    <el-button type="primary" @click="rejectsuccess">确 定</el-button>
                    <el-button @click="dialogFormVisible1 = false">取 消</el-button>
                </span>
            </el-dialog>
            <el-table :data="tableData" style="width: 100%" border
                :header-cell-style="{'text-align': 'center','background': '#eef1f6'}" highlight-current-row
                @current-change="">
                <el-table-column type="selection" width="55" align="center"></el-table-column>
                <el-table-column prop="bloodDiscardId" label="报废申请编号" width="250" align="center">
                </el-table-column>
                <el-table-column prop="applicantId" label="报废申请人工号" width="250" align="center">
                </el-table-column>
                <el-table-column label="申请日期" width="300" align="center">
                    <template slot-scope="scope">
                        <i class="el-icon-time"></i>
                        <span style="margin-left: 10px">{{scope.row.applyTime}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="reviewerId" label="审核人工号" width="200" align="center">
                </el-table-column>
                <el-table-column label="审核日期" width="200" align="center">
                    <template slot-scope="scope">
                        <i class="el-icon-time"></i>
                        <span style="margin-left: 10px">{{scope.row.reviewTime}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="state" label="状态" width="150" align="center">
                    <template slot-scope="scope">
                        {{ getblooddiscardstateName(scope.row.state) }}
                    </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" width="180" align="left">
                    <template slot-scope="scope">
<!--                        <el-button size="mini" type="danger" @click="handleEdit(scope.$index, scope.row)">修改</el-button>-->
<!--                        <el-button size="mini" type="danger" @click="del(scope.row.id)">删除</el-button>-->
                        <el-button size="mini" type="danger" :disabled="scope.row.state == '02'||scope.row.state == '03'||scope.row.state == '04'" @click="handleaudit(scope.$index, scope.row)">审核</el-button>
                        <el-button size="mini" type="danger" :disabled="scope.row.state == '02'||scope.row.state == '03'||scope.row.state == '04'" @click="handlebohui(scope.$index, scope.row)">申请驳回</el-button>
                    </template>
                </el-table-column>
            </el-table>

            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="pageNum"
                    :page-sizes="[1, 2, 3, 4]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="total"
                    style="text-align: center; margin-top: 20px;"/>
        </template>
    </div>

    <script src="/plugins/vue-2.6.11/vue.js"></script>
    <script src="/js/jquery.min.js"></script>
<!--    <script src="../plugins/element-2.4.5/index.js"></script>-->
    <script src="/js/2.15.12/index.js"></script>
    <link href="/css/2.15.12/index.min.css" rel="stylesheet">
    <script src="/js/httpVueLoader.js"></script>
    <script src="/icons/iconfont.js"></script>
    <script src="/plugins/axios-0.27.2/axios.min.js"></script>
    <script>Vue.prototype.$ELEMENT = { size: 'medium' };</script>
    <script>
        (function () {
            let urlBase = "/discard"
            var vm = window.vm = new Vue({
                el: '.data-manage-table',
                data() {
                    return {
                        pageNum: 1,
                        pageSize: 1,
                        total: 0,
                        bohuiform: {},
                        //血液状态列表
                        stateList : [],
                        //ABO血型列表
                        aboBloodTypeList : [],
                        //Rh血型列表
                        rhBloodTypeList : [],
                        //血液成分列表
                        bloodComponentList : [],
                        // 血量列表
                        bloodSizeList : [],
                        //血液位置
                        bloodLocationList: [],
                        //血液来源列表
                        bloodSourceList : [],
                        //报废原因选择
                        blooddiscardreasonlist: [],
                        //状态选择
                        stateselect: [],
                        //弹出框显示
                        form:{},
                        size: '',
                        selectform:{},
                        dialogVisible: false,
                        dialogFormVisible:false,//审核表单
                        dialogFormVisible1:false,//驳回表单
                        //搜索样本信息
                        searchapply: {
                            discardapplyid: '',//申请编号
                            applyid:'',//申请人工号
                            state:'',//状态
                            dateVal: '',    //日期范围
                        },
                        user: {
                            "accountNonExpired": true,
                            "accountNonLocked": true,
                            "credentialsNonExpired": true,
                            "enable": false,
                            "enabled": false,
                            "jobnum": "tom",
                            "menuUrls": {
                                "menu": [{
                                    "urls": [{
                                        "id": "11",
                                        "title": "11",
                                        "url": "/pages/error/403.html",
                                        "titleflag": "error"
                                    }], "title": "testerror", "titleflag": "error"
                                }, {
                                    "urls": [{
                                        "id": "22",
                                        "title": "5-5",
                                        "url": "/pages/error/505.html",
                                        "titleflag": "testerror"
                                    }], "title": "testerror2", "titleflag": "testerror"
                                }]
                            },
                            "noLocked": false,
                            "personalization": {
                                "asideFold": false,
                                "mainTabsHeaderFixed": true,
                                "asideControlOpen": false,
                                "headerSkin": "colorful",
                                "headerFixed": false,
                                "skin": "brown",
                                "asideSkin": "dark",
                                "asideControlFixed": true
                            },
                            "username": "tom"
                        },
                        LS: {
                            'word-break': 'keep-all'
                        },
                        CS: {
                            'max-width': '500px',
                            'word-break': 'break-all',
                            'display': 'table-cell',
                            'vertical-align': 'middle'
                        },
                        //表格信息
                        tableData: [],
                        labelPosition: 'right',
                        //新增样本信息
                        addForm: {
                            A_blood_sample_number: '',
                            Blood_number: '',
                            state: '',
                            The_sample_location: '',
                            Operation_of: '',
                            Operating_manual: ''
                        },
                        //新增样本表单验证
                        addFormRules: {
                            A_blood_sample_number: [
                                { required: true, message: '请输入样本编号', trigger: 'blur' },
                            ],
                            Blood_number: [
                                { required: true, message: '请输入血液编号', trigger: 'blur' },
                            ],
                            state: [
                                { required: true, message: '请选择样本状态', trigger: 'change' },
                            ],
                            The_sample_location: [
                                { required: true, message: '请选择样本位置', trigger: 'change' },
                            ],
                            Operation_of: [
                                { required: true, message: '请输入操作人', trigger: 'blur' },
                            ],
                            Operating_manual: [
                                { required: true, message: '请输入操作人工号', trigger: 'blur' },
                            ]
                        }
                    }
                },
                created(){
                    this.load();
                    this.format1();

                },
                mounted() {
                    this.user = sessionStorage.getItem("user") ? JSON.parse(sessionStorage.getItem("user")) : {};
                    this.getBloodDiscardReason();
                    this.getBloodDiscardState();
                    this.getAboBloodType();
                    this.getRhBloodType();
                    this.getBloodComponent();
                    this.getBloodLocation();
                    this.getBloodSize();
                    this.getBloodSource();
                },
                methods: {
                    //分页查询
                    load() {
                        axios.get('/audit/review/page',{
                        params: {
                            pageNum: this.pageNum,
                            pageSize: this.pageSize,
                        }
                    }).then(res => {
                        console.log(this.pageNum)
                        console.log(res)
                        console.log(this.pageSize)
                        this.tableData = res.data.records
                        this.total = res.data.total
                    })
                        // $.get(urlBase + "/page?pageNum=" + this.pageNum + "&pageSize=" + this.pageSize+"&id="+this.id).then(res => {
                        //     this.tableData = res.records
                        //     this.total = res.total
                        // })
                    },//查询
                    queryload(){
                        let dateval1=this.searchapply.dateVal
                        for(let i =0 ; i<dateval1.length ; i++){
                            if(dateval1[i] instanceof Date)
                                console.log("11")

                        }
                        let startTime = dateval1[0]
                        let endTime = dateval1[1]
                        console.log("-----"+endTime)
                        axios.get('/audit/review/querypage',{
                            params: {
                                pageNum: this.pageNum,
                                pageSize: this.pageSize,
                                discardapplyid: this.searchapply.discardapplyid,
                                applyid: this.searchapply.applyid,
                                state: this.searchapply.state,
                                startTime: startTime,
                                endTime: endTime,
                            }
                        }).then(res => {
                            console.log(res)
                            console.log("----------------------")
                            this.tableData = res.data.records
                            this.total = res.data.total

                        })
                    },
                    handleSizeChange(pageSize) {
                        this.pageSize = pageSize;
                        console.log(pageSize)
                        this.load();
                    },
                    handleCurrentChange (pageNum) {
                        this.pageNum = pageNum;
                        console.log(pageNum)
                        this.load();
                    },
                    handleEdit(index, row) {
                        console.log(index, row);
                        this.form=row
                        this.dialogFormVisible = true
                    },
                    handleDelete(index, row) {
                        console.log(index, row);
                    },
                    handleaudit(index, row){
                        console.log(index, row);
                        this.form.bloodDiscardId = row.bloodDiscardId;
                        console.log(this.form.bloodDiscardId)
                        axios.get('/audit/review/getselectapply',{
                            params: {
                                discardapplyid: this.form.bloodDiscardId,
                            }
                        }).then(res => {
                            if (res.data.code === '200') {
                                console.log(res.data.data)
                                this.selectform  = res.data.data
                                this.selectform.scrapReason = this.selectform.scrapReason
                                this.selectform.aboBloodType = this.selectform.aboBloodType
                                this.selectform.rhBloodType = this.selectform.rhBloodType
                                this.selectform.bloodComponent = this.selectform.bloodComponent
                                this.selectform.reviewerId = this.user.jobnum
                                this.selectform.reviewer = this.user.username

                                this.dialogFormVisible = true
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                    },
                    handlebohui(index, row){
                        this.selectform.rejectReason=''
                        console.log(index, row);
                        this.form.bloodDiscardId = row.bloodDiscardId;
                        console.log(this.form.bloodDiscardId)
                        axios.get('/audit/review/getselectapply',{
                            params: {
                                discardapplyid: this.form.bloodDiscardId,
                            }
                        }).then(res => {
                            if (res.data.code === '200') {
                                console.log(res.data.data)
                                this.selectform  = res.data.data
                                this.selectform.scrapReason = this.selectform.scrapReason
                                this.selectform.aboBloodType = this.selectform.aboBloodType
                                this.selectform.rhBloodType = this.selectform.rhBloodType
                                this.selectform.bloodComponent = this.selectform.bloodComponent
                                this.selectform.reviewerId = this.user.jobnum
                                this.selectform.reviewer = this.user.username
                                this.dialogFormVisible1 = true
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                    },
                    aduitsuccess(){
                        console.log(this.selectform.id)
                        axios.get('/audit/review/success',{
                            params: {
                                discardapplyid: this.selectform.applyId,
                                bloodId: this.selectform.bloodId,
                                reviewerId: this.selectform.reviewerId,
                            }
                        }).then(res => {
                            if (res) {
                                this.$notify({
                                    title:'成功',
                                    message:'审核成功',
                                    type:'success'
                                })
                                this.dialogFormVisible = false
                                this.load()
                            } else {
                                this.$message.error("保存失败")
                            }
                        })
                    },
                    rejectsuccess(){
                        console.log(this.selectform.id)
                        axios.get('/audit/review/rejectsuccess',{
                            params: {
                                discardapplyid: this.selectform.applyId,
                                bloodId: this.selectform.bloodId,
                                reviewerId: this.selectform.reviewerId,
                                rejectReason:this.selectform.rejectReason
                            }
                        }).then(res => {
                            if (res) {
                                this.$notify({
                                    title:'成功',
                                    message:'驳回成功',
                                    type:'success'
                                })
                                this.dialogFormVisible1 = false
                                this.load()
                            } else {
                                this.$message.error("保存失败")
                            }
                        })
                    },
                    reset(){
                        this.searchapply.discardapplyid = ""
                        this.searchapply.applyid = ""
                        this.searchapply.state = ""
                        this.searchapply.dateVal = ""
                        this.load()
                    },
                    //取消按钮
                    cancel(){
                        this.dialogVisible = false
                    },
                    // 获取报废原因字典
                    getBloodDiscardReason(){
                        axios.get('/bloodDiscardReason/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.blooddiscardreasonlist = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中报废原因字段的code转换成name
                    getblooddiscardreasonName(code){
                        for (var i = 0; i < this.blooddiscardreasonlist.length; i++) {
                            if (this.blooddiscardreasonlist[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.blooddiscardreasonlist[i].name;
                            }
                        }
                    },
                    // 获取报废状态字典
                    getBloodDiscardState(){
                        axios.get('/BloodDiscardState/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.stateselect = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中报废状态字段的code转换成name
                    getblooddiscardstateName(code){
                        for (var i = 0; i < this.stateselect.length; i++) {
                            if (this.stateselect[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.stateselect[i].name;
                            }
                        }
                    },
                    // 获取状态字典
                    getState(){
                        axios.get('/state/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200'){
                                    this.stateList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title : '错误',
                                        message : '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的State字段的code转换成name
                    getStateName(code){
                        for (var i=0;i<this.stateList.length;i++){
                            if (this.stateList[i].code == code){
                                return this.stateList[i].state
                            }
                        }
                    },

                    // 获取abo血型字典
                    getAboBloodType(){
                        axios.get('/aboType/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.aboBloodTypeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中aboBloodType字段的code转换成name
                    getAboBloodName(code){
                        for (var i = 0; i < this.aboBloodTypeList.length; i++) {
                            if (this.aboBloodTypeList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.aboBloodTypeList[i].name;
                            }
                        }
                    },
                    // 获取血液来源字典
                    getBloodSource(){
                        axios.get('/bloodSource/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.bloodSourceList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中BloodSource字段的code转换成name
                    getBloodSourceName(code){
                        for (var i = 0; i < this.bloodSourceList.length; i++) {
                            if (this.bloodSourceList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.bloodSourceList[i].source;
                            }
                        }
                    },
                    // 获取血量字典
                    getBloodSize(){
                        axios.get('/bloodSize/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.bloodSizeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中bloodCount字段的code转换成size
                    getBloodSizeName(code){
                        for (var i = 0; i < this.bloodSizeList.length; i++) {
                            if (this.bloodSizeList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.bloodSizeList[i].size;
                            }
                        }
                    },


                    // 获取rh血型字典
                    getRhBloodType(){
                        axios.get('/rhType/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.rhBloodTypeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中rhType字段的code转换成name
                    getRhBloodName(code){
                        for (var i = 0; i < this.rhBloodTypeList.length; i++) {
                            if (this.rhBloodTypeList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.rhBloodTypeList[i].name;
                            }
                        }
                    },


                    // 获取血液成分字典
                    getBloodComponent(){
                        axios.get('/bloodComposition/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.bloodComponentList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },

                    // 将表格中bloodComponent字段的code转换成name
                    getBloodComponentName(code){
                        for (var i = 0; i < this.bloodComponentList.length; i++) {
                            if (this.bloodComponentList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.bloodComponentList[i].composition;
                            }
                        }
                    },
                    // 获取血液位置字典
                    getBloodLocation(){
                        axios.get('/bloodLocation/normal/getName')
                            .then((res)=>{
                                if (res.data.code === '200') {
                                    this.bloodLocationList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败',
                                    })
                                }
                            })
                    },
                    // 将表格中bloodLocation字段的code转换成name
                    getBloodLocationName(code){
                        for (var i = 0; i < this.bloodLocationList.length; i++) {
                            if (this.bloodLocationList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                                return this.bloodLocationList[i].location;
                            }
                        }
                    },
                    format1() {
                        var _this = this;
                        let yy = new Date().getFullYear();
                        let mm = new Date().getMonth()+1;
                        let dd = new Date().getDate();
                        let hh = new Date().getHours();
                        let mf = new Date().getMinutes()<10 ? '0'+new Date().getMinutes() : new Date().getMinutes();
                        let ss = new Date().getSeconds()<10 ? '0'+new Date().getSeconds() : new Date().getSeconds();
                        _this.sendTime = yy+'/'+mm+'/'+dd+' '+hh+':'+mf+':'+ss;

                    }, //获取当前时间
                }

            });
        })()
    </script>


</body>

</html>